
import network
import socket
from machine import Pin, I2C
import ssd1306
import machine
i2c = I2C(scl=Pin(5), sda=Pin(4))
oled = ssd1306.SSD1306_I2C(128, 64, i2c)



sock = socket.socket()
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
nic = network.WLAN(network.STA_IF)
nic.active(True)        
nic.connect("LIU","15929665250")

while not nic.isconnected():
    pass
sock.connect(('192.168.137.1',4444))
print('ok')
while True:
    sock.send(b's')
    oled.buffer = sock.recv(1024)
    oled.show()
'''
    if recive == b'close':
        sock.close()
        break
'''

